{
  path: '/student/:studentid',
  component: StudentView
}<template>
  <div>
    {{ studentId }}
  </div>
</template>

<script>
export default {
  name: 'HomeView',

  data() {
    return {
      studentId: '',
    };
  },
  created() {
    this.getStudentId();
  },
  watch: {
    '$route.params.studentId': function(newid) {
      this.studentId = newid;
    }
  },
  methods: {
    getStudentId() {
      const studentid = this.$route.params.studentid;
      console.log(studentid);
      this.studentId = studentid;
    }
  }
};
</script>